<?php 
session_start(); 
      if (isset($_SESSION['k_username'])) {
		  ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Registrar Socio Nuevo</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
<style type="text/css">
<!--
.Estilo1 {font-size: 24px}
-->
</style>
   <link rel="stylesheet" type="text/css" media="all" href="../../calendario/calendar-green.css" title="win2k-cold-1" /> 
 <!-- librerÃ­a principal del calendario -->
 <script type="text/javascript" src="../../calendario/calendar.js"></script>
 <!-- librerÃ­a para cargar el lenguaje deseado -->
  <script type="text/javascript" src="../../calendario/lang/calendar-es.js"></script>
  <!-- librerÃ­a que declara la funciÃ³n Calendar.setup, que ayuda a generar un calendario en unas pocas lÃ­neas de cÃ³digo -->
  <script type="text/javascript" src="../../calendario/calendar-setup.js"></script>    
 <script type="text/javascript" src="../../js/funciones.js"></script>    
  
</head>

<body>

<?php 

  include('../../conexion.inc.php');
  $link = Conectarse();

mysql_select_db("gotica_sociosgotica" ,$link);
if ($_GET[msj]==1){
echo "Su registro fue exitoso";
}
if ($_GET[msj]==2){
echo "Su registro no se realizo";
}
?>
<h1>Registrar Socio Nuevo</h1>
<form method="post" action="regsocio.php">
<div id="dperson">
Datos Personales
<table class="one" >
<tr>
<td>
  Nombre </td>
  <td>
  <input type="text" name="nombre" maxlength="50" size="50" />
  </td></tr>
<tr>
    <td>Apellido Paterno</td>
 <td>
    <input type="text" name="appaterno" maxlength="50" size="50"/>
    </td>
</tr>
<tr>
    <td>Apellido Materno</td>
 <td>
    <input type="text" name="apmaterno" maxlength="50" size="50" />
    </td>
</tr>
<tr>
<?php
$sql = "SELECT * FROM tipodocumento";
$result = mysql_query($sql, $link);
echo "<td>Tipo Documento</td>";
echo "<td width=\"40\"><select name=\"tdocumento\" >";
while ($row = mysql_fetch_array($result))
{
echo "<option value=\"".$row['iddocumento']."\">";
echo $row['documento'];
echo "</option>";
}
echo "</select>";
  ?>
   <input type="text" name="dni" maxlength="20"  /></td>
</tr>
<tr>

    <td>Direccion</td>
  
   <td> <input type="text" name="direccion" maxlength="100" size="50" />
   </td>
</tr>

<?php

$sql = "SELECT * FROM distrito";


$result = mysql_query($sql, $link);
echo "<tr>";
echo "<td>Distrito</td>";
echo "<td ><select name=\"distrito\" />";

while ($row = mysql_fetch_array($result))
{
echo "<option value=\"".$row['IdDistrit']."\">";
echo $row['Distrito'];
echo "</option>";
}
echo "</select></td>";
echo "</tr>";

  ?>
<tr>
<td>
Telefono
</td>
<td>
<input name="telefono" type="text"  maxlength="10" onkeypress="return permite(event, 'num')" />
</td>
</tr>
<tr>
<td>
Celular
</td>
<td>
<input name="celular" type="text"  maxlength="10"  onkeypress="return permite(event, 'num')" />
</td>
</tr>
<?php

$sql3 = "SELECT * FROM sexo";
$result3 = mysql_query($sql3, $link);
echo "<tr>";
echo "<td>Sexo</td>";
echo "<td><select name=\"sexo\" />";

while ($row3 = mysql_fetch_array($result3))
{
echo "<option value=\"".$row3['IdSexo']."\">";
echo $row3['Sexo'];
echo "</option>";
}
echo "</select></td>";
echo "</tr>";


?>
<tr>
<td>
Fecha Nacimiento</td>
<td>
<input name="fechnac" id="fechnac" type="text" value="aaaa-mm-dd" maxlength="10" /><input type="button"  value="..." onclick="return showCalendar('fechnac', '%Y-%m-%d' , '24', true);"  /> 
</td>
</tr>
<tr>
<td>
Email</td>
<td>
<input name="email"  type="text" id="email" />
</td>
</tr>
</table>
</div>
<div id="dsocio">
<table>
<tr>
<td>
Revista
</td>
<td>
<input name="revista" type="checkbox" value="1" />
</td>
</tr>
<?php

$sql1 = "SELECT * FROM clase";


$result1 = mysql_query($sql1, $link);
?>
<?php
$sql2 = "SELECT * FROM tiposocio";
$result2 = mysql_query($sql2, $link);
echo "<tr>";
echo "<td>Tipo Socio</td>";
echo"</tr>";
echo"<tr><td></td><td>";
echo"<table width=\"50%\">";
$i=0;
while ($row2 = mysql_fetch_array($result2))
{
$i++;
echo "<tr>";
echo "<td><input type=\"checkbox\" name=\"tiposocio[]\" value=".$row2['idTipoSocio'].">";
echo $row2['TipoSocio']."</td>";
echo "<td>Codigo";
echo "<input name=\"codigo[]\" maxlength=\"10\" size=\"10\" /></td>";
echo "<td>Clase</td>";
echo "<td><select name=\"clase[]\" />";

$sql3 = "SELECT * FROM clase";
$result3 = mysql_query($sql3, $link);
while ($row3 = mysql_fetch_array($result3))
{
echo "<option  value=\"".$row3['IdClase']."\">";
echo $row3['Clase'];
echo "</option>";
}

echo "</select></td>";
echo "<td>Ingreso<input name=\"fechingr[]\" id=\"fechaingreso$i\" type=\"text\" value=\"aaaa-mm-dd\" maxlength=\"10\" size=\"10\" /><input type=\"button\"  value=\"...\" onclick=\"return showCalendar('fechaingreso$i', '%Y-%m-%d' , '24', true);\" /></td>  ";
$sql26 = "SELECT * FROM moneda";
$result26 = mysql_query($sql26, $link);
echo "<td>Pago<select name=\"moneda[]\" />";

while ($row26 = mysql_fetch_array($result26))
{
echo "<option value=\"".$row26['idmoneda']."\">";
echo $row26['tagmon'];
echo "</option>";
}
echo "</select><input name=\"pago[]\"  type=\"text\" maxlength=\"10\" size=\"10\" />";
echo "</tr>";
}
echo "</table>";
echo "</td></tr>";


?>

<tr>
<td>
<input type="submit" value="enviar" name="enviar"  />
</td>
<td>
<input type="reset" value="Limpiar" />
</td>
</tr>
</table>
</div>
</form>
<div align="center" >
<a href="index2.php">Inicio</a></div>
</body>
</html>
<?
}else
{
	echo "<SCRIPT LANGUAGE=\"javascript\">";
echo "location.href = \"index.php\"";
echo "</SCRIPT>";
	}
?>
